<?php
 $db = mysql_connect("mysql513.in.shared-server.net:16033", "JRtu434", "qvoiceDB1");
 mysql_select_db("JRtu434", $db);
 mysql_query("SET NAMES utf8");
 $result = mysql_query("Select count(*),spireproject.name from manualrental,spireproject where manualrental.rid=spireproject.rid and manualrental.rid in (select distinct rid from manualrental)");
 while($res = mysql_fetch_array($result))
 echo "$res[1] --- $res[0] <br>";
 mysql_close();
?>